<?php

namespace app\api\controller\company;
use app\shop\model\company\Station;
use app\shop\service\company\Train as TrainService;
/**
 * 团队风采
 */
class Train
{
    /**
     * 员工列表
     */
    public function file(TrainService $TrainService)
    {
        $data = input();
        return $TrainService->files($data);
    }

    public function students(TrainService $TrainService)
    {
        $data = input();
        $my_stations = Station::where('trainer', request()->user_id)->column('id');
        $data['station_id'] = $my_stations;
        return $TrainService->students($data);
    }

    public function isTrainer(TrainService $TrainService)
    {
        $data = input();
        return $TrainService->isTrainer($data);
    }

    public function saveFile(TrainService $TrainService)
    {
        $data = input();
        $data['add_user'] = request()->user_id;
        return $TrainService->saveFile($data);
    }

    public function detail(TrainService $TrainService)
    {
        $user_iud = input('user_id');
        return $TrainService->trainDetail($user_iud);
    }

    public function logs(TrainService $TrainService)
    {
        $data = input();
        return $TrainService->trainLog($data);
    }

    public function saveLog(TrainService $TrainService)
    {
        $data = input();
        $data['trainer'] = request()->user_id;
        return $TrainService->saveLog($data);
    }
}